<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="../css/common.css?01_38" />
		<link rel="stylesheet" type="text/css" href="../css/templet.css?01_38" />
		<link rel="stylesheet" type="text/css" href="../fonts/font-awesome.min.css?01_38" />
		<link rel="stylesheet" type="text/css" href="../mui/css/mui.css?01_38" />

		<!--公共js-->
		<script type="text/javascript" src="../common/js/jquery.js?01_38"></script>
		
		<!--插件-->
		<script type="text/javascript" src="../common/js/vue.min.js?01_38"></script>
		<script type="text/javascript" src="../common/js/mui.min.js?01_38"></script>
		
		<script type="text/javascript" src="../common/js/fastclick.js?01_38"></script>
		<script type="text/javascript" src="../common/js/common.js?01_38"></script>
		<script type="text/javascript" src="../common/js/my_common.js?01_38"></script>
		<script type="text/javascript" src="../common/js/main.js?01_38"></script>
		<script type="text/javascript" src="../common/js/app.js?01_38"></script>
	</head>

	<body>
		<header class="bg-red9 fff f-20 pad-t-10 pad-b-25 pad-r-10">
			<div class="pa back pad-l-10 re" onclick="cli_backpre()">
				<a></a>
				<div class="order_back"></div>
			</div>
			<div class="center"></div>
			<div class="pa see f-14 re" style="right: 10px;" onclick="clicked('vipCardManage.html')">
				<div class="order_back_1"></div>
				<a class="fff" data-l="1078"></a>
			</div>
		</header>
		<div id="app" v-cloak>
			<div class="wrap_body discount_coupon">
				<div class="content pad-t-45 pad-b-300">
					<!--搜索部分-->
					<div class="top bg-red9 pad-l-10 pad-r-10 pad-t-25">
						<p class="fff f-24">{{b_lg[1336]}}</p>
						<div class="bg-fff fiex pad-r-20 search">
							<div class="fiex1 pad-l-12 pad-r-12 f-24 fiex" style="height: 3em;">
								<div v-if="couponSn">{{couponSn}}</div>
								<div class="c999 f-20" v-else>{{b_lg[1337]}}</div>
							</div>
							<div class="scan" @click="scan"></div>
						</div>
					</div>

					<div class="pad-r-10 pad-l-10 pad-t-70 center">
						<div>
							<a class="bg-red9 fff pad-t-15 pad-b-15 pad-l-70 pad-r-70 f-15 btn" @click="sure">{{b_lg[1008]}}</a>
						</div>
					</div>
					<div class="bank20"></div>
				</div>

				<div class="number-key">
					<ul class="cf f-24">

						<li @touchstart="numberk(1)"><span>1</span></li>
						<li @touchstart="numberk(2)"><span>2</span></li>
						<li @touchstart="numberk(3)"><span>3</span></li>
						<li @touchstart="numberk(4)"><span>4</span></li>
						<li @touchstart="numberk(5)"><span>5</span></li>
						<li @touchstart="numberk(6)"><span>6</span></li>
						<li @touchstart="numberk(7)"><span>7</span></li>
						<li @touchstart="numberk(8)"><span>8</span></li>
						<li @touchstart="numberk(9)"><span>9</span></li>
						<li @touchstart="numberk('C')"><span>C</span></li>
						<li @touchstart="numberk(0)"><span>0</span></li>
						<li @touchstart="numberk('d')"><span><img src="../images/w/del.png"></span></li>
					</ul>
				</div>

			</div>

	</body>

	<script type="text/javascript">
		var app = null;
		var getScan = getQueryString("scan");
		if(getScan == 1) {
			setTimeout(function() {
				app.gotoart("../qrcode/qrscan.html?id=0&type=5")
			}, 300)
		}

		function refresh() {
			app.init();
		}
        function cli_backpre(){
        	app.backpre()
        }
		function fun1() {
            setlange_obj(); //加载头部语言包
			app = new Vue({
				el: "#app",
				data: {
					couponSn: "",
					shop_name: "",
					shop_list_name: "",
					h: "", //是否适用本店铺
					status: "", //优惠券状态
					b_lg: global_lange, //语言包

				},
				created: function() {
					this.init();
				},
				methods: {
					init: function() {
						common_ajax(1, {
							sn: this.couponSn
						}, "get_home", function(res) {
							if(res.status == 1) {
								app.shop_name = res.result.shop_info.shop_name;
							}
						})

					},
					numberk: function(e) { //按键
						var n = this.couponSn;
						switch(e) {
							case "d":
								n = n.substring(0, n.length - 1);
								break;
							case "C":
								n = "";
								break;
							default:
								n += e;
								break;
						}
						if(n.length > 11) {
							return;
						}
						this.couponSn = n;
					},
					gotoart: function(e) {
						clicked(e);
					},
					sure: function() {
						common_ajax(1, {
							mobile: this.couponSn
						}, "get_card_info_by_mobileSn", function(res) {
							if(res.status == 1) {
								app.gotoart("vipCardInfor.html?id=1&couponSn=" + app.couponSn)
								app.couponSn = "";
							} else {
								mui.toast(res.msg);
							}
						})
					},
					scan: function() {
						setTimeout(function() {
							app.gotoart("../qrcode/qrscan.html?id=0&type=5");
						}, 500)
					},
					backpre: function() {
						if(isAPP) {
							var preUrl = plus.webview.currentWebview().opener();
							preUrl.evalJS("refresh()");
						}
						com_back();
					}

				}

			})
		}
	</script>

</html>
